package cn.yeyiu.util;

import android.content.Context;

public class NetConfig {
    public static final String FAIL_IP = "IP获取失败";
    private static String host = null;
    private static String ip = "192.168.1.100";
    private static String port = "8888";
    public static String[] quickIps = {"192.168.1.100", "192.168.2.100", "192.168.123.100", "192.168.43.228", "192.168.43.47", "192.168.31.69", "10.0.2.2", "10.42.0.1"};

    public static String getOldIp(Context context) {
        return ExternalJSONFile.loadIp(context);
    }

    public static String getIp() {
        return ip;
    }

    public static boolean setIp(Context context, String str) {
        if (FAIL_IP.equals(str)) {
            return false;
        }
        ip = str;
        host = "http://" + ip + ":" + port;
        ExternalJSONFile.saveIp(context, str);
        return true;
    }

    public static String getPort() {
        return port;
    }

    public static void setPort(String str) {
        port = str;
        host = "http://" + ip + ":" + port;
    }

    public static String getHost() {
        return host;
    }

    public static void setHost(String str) {
        host = str;
    }

    public static void setHost(String str, String str2) {
        host = "http://" + str + ":" + str2;
    }
}
